import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class ActionTextButton extends StatelessWidget {
  String title;
  double left;
  double right;
  double width;
  double height;
  VoidCallback? onPressed;
  // typedef Function Name(params);
  ActionTextButton(
      {required this.title,
      required this.width,
      required this.height,
      this.left = 0,
      this.right = 0,
      required this.onPressed});
  @override
  Widget build(BuildContext context) {
    return Container(
      // width: 70.w,
      margin: EdgeInsets.only(left: this.left, right: this.right),
      child: TextButton(
        onPressed: onPressed,
        child: Text(title),
        style: ButtonStyle(
            minimumSize:
                MaterialStateProperty.all(Size(this.width, this.height)),
            tapTargetSize: MaterialTapTargetSize.shrinkWrap,
            padding: MaterialStateProperty.all(EdgeInsets.all(0)),
            foregroundColor: MaterialStateProperty.all(Colors.white),
            textStyle: MaterialStateProperty.all(
                TextStyle(fontSize: 46.sp, fontWeight: FontWeight.w500))),
      ),
    );
  }
}
